<?php
    header('Content-Type: text/html; charset=UTF-8');
    include_once '../config.php';

    if ($_COOKIE['LOG'] == false) {
        header('Location: ../index.php');
    }

    include '../layout/header.php';
?>
<body>
    <div data-role="page">
        <div data-role="header" data-theme="b" class="ui-overlay-shadow">
            <h1>
            <?php
                if ($_GET['list'] == 'cl') {
                    echo 'Auftraggeber';
                } else if ($_GET['list'] == 'pm') {
                    echo 'Projektleiter';
                } else {
                    echo 'Kaufm&auml;nner';
                }
            ?>
            </h1>
            <a href="./index.php" data-role="button" data-icon="back" class="ui-btn-left" data-theme="a">Menü</a>
<!--            <a href="add_client.php" data-role="button" data-icon="add" class="ui-btn-right" data-theme="a">Add</a>-->
        </div>
        <div data-role="content" data-theme="c">
            <?php
                if ($_GET['fail'] == 'cleer') {
            ?>
                    <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                        <li class="ui-li ui-li-static ui-body-c ui-corner-top">
                            <table align="center">
                                <tr>
                                    <td style="vertical-align: middle; text-align:center">
                                        <font style="color:red">
                                            Der Auftraggeber wurde nicht gespeichert, da ein Textfeld leer war!
                                        </font>
                                    </td>
                                </tr>
                            </table>
                        </li>
                    </ul>
            <?php
                } else if ($_GET['fail'] == 'kleer') {
            ?>
                    <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                        <li class="ui-li ui-li-static ui-body-c ui-corner-top">
                            <table align="center">
                                <tr>
                                    <td style="vertical-align: middle; text-align:center">
                                        <font style="color:red">
                                            Der Kaufmann wurde nicht gespeichert, da das Namensfeld leer war!
                                        </font>
                                    </td>
                                </tr>
                            </table>
                        </li>
                    </ul>
            <?php
                } else if ($_GET['fail'] == 'pmleer') {
            ?>
                    <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                        <li class="ui-li ui-li-static ui-body-c ui-corner-top">
                            <table align="center">
                                <tr>
                                    <td style="vertical-align: middle; text-align:center">
                                        <font style="color:red">
                                            Der Projektleiter wurde nicht gespeichert, da das Namensfeld leer war!
                                        </font>
                                    </td>
                                </tr>
                            </table>
                        </li>
                    </ul>
            <?php
                }
            ?>
            <ul class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" data-role="listview">
                <li class="ui-li ui-li-static ui-body-c ui-corner-top">
                    <table align="center">
                        <tr>
                            <td style="vertical-align: middle; text-align:center">
                                In dem vorhanden Suchfeld, den Suchbegriff eingeben,
                                es wird automatisch danach gesucht!
                            </td>
                        </tr>
                    </table>
                </li>
            </ul>
            <br />
            <?php
                include_once 'php/delete.php';

                if ($_GET['list'] == 'cl') {
                    include_once 'list/client_list.php';
                } else if ($_GET['list'] == 'pm') {
                    include_once 'list/pmanager_list.php';
                } else {
                    include_once 'list/buyer_list.php';
                }
            ?>
        </div>
        <div data-role="footer" data-theme="c">
            <h4>Eingeloggt als: <strong><?php echo $_COOKIE['VNAME'] . ' ' . $_COOKIE['NNAME']; ?></strong></h4>
        </div>
    </div>
</body>
</html>